//
//  GoodsDetailTableViewCell.m
//  Mall
//
//  Created by 孙飞燕 on 16/10/11.
//  Copyright © 2016年 孙飞燕. All rights reserved.
//

#import "GoodsDetailTableViewCell.h"
#import <ShareSDK/ShareSDK.h>
#import <ShareSDKUI/ShareSDK+SSUI.h>
@implementation GoodsDetailTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.titleLabel.adjustsFontSizeToFitWidth = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

- (IBAction)shareBtn:(id)sender {

    //1、创建分享参数
    NSArray* imageArray = @[[UIImage imageNamed:@"k0"]];
    //如果要分享网络图片，可以这样传iamge参数 images:@[@"http://mob.com/Assets/images/logo.png?v=20150320"]）
    if (imageArray) {

        NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
        [shareParams SSDKSetupShareParamsByText:@"分享内容"
                                         images:imageArray
                                            url:[NSURL URLWithString:@"http://mob.com"]
                                          title:@"测试"
                                           type:SSDKContentTypeAuto];
        [ShareSDK share:SSDKPlatformTypeWechat parameters:shareParams onStateChanged:^(SSDKResponseState state, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error) {
            NSLog(@"%@",error);
        }];

    }
}
@end
